package com.example.entity.enums;

/**
 * 支付方式枚举类
 */
public enum PayTypeEnum {
    ALIPAY(1, "支付宝"),
    WECHAT(2, "微信"),
    CASH_ON_DELIVERY(3, "货到付款");

    private Integer code;
    private String description;

    PayTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public String desc() {
        return description;
    }

    public static String desc(Integer code) {
        for (PayTypeEnum payType : values()) {
            if (payType.getCode().equals(code)) {
                return payType.desc();
            }
        }
        return "未知支付方式";
    }
}